package com.yykj.hospital.server.model.repository.banci;

import com.yykj.hospital.server.model.entity.banci.HospitalDoctorBanCi;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;

@Repository
public interface HospitalDoctorBanCiRepository extends JpaRepository<HospitalDoctorBanCi,Integer>, JpaSpecificationExecutor<HospitalDoctorBanCi> {
    HospitalDoctorBanCi findFirstByHospitalIdAndDoctorIdAndBanCiIdAndDay(Integer hospitalId, String doctorId, Integer banCiId, LocalDate day);

    List<HospitalDoctorBanCi> findAllByHospitalIdAndDoctorIdAndDayAndBanCiId(Integer hospitalId, String doctorId,  LocalDate day,Integer banCiId);

    HospitalDoctorBanCi findFirstByDoctorIdAndDayAndStartTimeAndEndTimeAndBanCiId(String doctorId, LocalDate day, LocalTime startTime,LocalTime endTime,Integer banCiId);

}
